using System;
using System.Text.RegularExpressions;

namespace DynamicConfigurationManager.ConfigMapAttributes
{
    internal class HostnameRegEx : IConfigMapAttribute
    {
        public bool Execute( string configMapAttribute )
        {
            LogHelper.Append( "Hostname: matching to {0}", Environment.MachineName );
            var re = new Regex( configMapAttribute, RegexOptions.IgnoreCase );
            return re.IsMatch( Environment.MachineName );
        }
    }
}